package com.itxz.handler;

import org.xml.sax.ErrorHandler;
import org.xml.sax.SAXException;
import org.xml.sax.SAXParseException;

/**
 * xml错误处理器
 *
 * @author ldt
 * @date 2019/12/2 15:58
 */
public class MyErrorHandler implements ErrorHandler {
    @Override
    public void warning(SAXParseException exception) throws SAXException {
        System.out.println("warning：" + exception.getMessage());
    }

    @Override
    public void error(SAXParseException exception) throws SAXException {
        System.err.println("error：" + exception.getMessage());
    }

    @Override
    public void fatalError(SAXParseException exception) throws SAXException {
        System.err.println("fatalError：" + exception.getMessage());
    }
}
